package reader;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class GithubRepoPageProcessor {

	public static void main(String[] args) throws Exception {
		//获取主页全部
		Document doc = Jsoup.connect("http://weixin.sogou.com/").get();
		//微信热搜棒
		Elements topwords_1 = doc.select("#topwords_1");
		Elements topwords_2 = doc.select("#topwords_2");
		//订阅热词
		Elements dy_words = doc.select("re-box");
		//最热收藏/最热内容
		Elements zrsc_words = doc.select("sc_news");
		//顶部大图
		Elements dbu_words = doc.select("#wx-topbpx");
		//中间内容
		for (int i = 0; i < 20; i++) {
			Elements wx = doc.select(".wx-news-info"+i);
			if(wx!= null && wx.size() >0){
				for(Element element : wx){
					String url = element.getElementsByTag("a").attr("href");
					Document content = Jsoup.connect(url).get();
					System.out.println(content.select("#js_content").text());
					GetComment.getComments(url);
				}
			}
			System.out.println(i);
		}
		
	}
}